from typing import Any, Optional, Union
from pydantic import BaseModel
from .message import MessageMetrics, Message

# to-do: support exception cases
class ModelResponse(BaseModel):
    """
    Response returned by chat requests.
    """
    id: str

    created_at: Optional[Any] = None
    'Time when the request was created.'
    provider: str

    metrics: Optional[MessageMetrics] = None

    'Response message.'
    message: Message